import tool from '../tool'
import util from '_util/index'
import logic from '_logic'
const store = util.store
import _ from 'lodash'

export default{
    beforeAdd(_this,clb){
        if(!_this.$route.query.top_product_id) {

            util.showMybind(_this, {
                bindModel: 103,
                title: '请选择商品',
                name: 'top_product_id',
                _id: 'add/Product'
            }, (fname, val, title) => {

                let top_product_id = val;
                if (top_product_id) {
                    let url = '/page/add?ctl=Product&top_product_id=' + top_product_id;
                    _this.$router.push(url);
                }

            });


        }else{
            clb();
        }
    }
}
